<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<title></title>
</head>
<body>
	<script type="text/javascript">
		let str = "孙悟空摘西瓜"

		// replace(旧字符串，要替换新字符串) 字符串替换 返回新的字符串
		console.log(str.replace("西瓜","包子"))//孙悟空摘包子

		// split() 分割字符串 返回数组
		let str2 = "http://www.baidu.com?user=孙悟空&sex=男"

		let newStr = str2.split("?")[1].split("&")	
		console.log(newStr)
		newStr.forEach(function(item,index){
			console.log(item.split("=")[1])
		})

		
		// toLowerCase()小写
		// toUpperCase()大写
		let str3 = "Good good study,day day up"
		console.log(str3.toLowerCase)//
		console.log(str3.toUpperCase)//GOOD
</script>
</body>
</html>